
<style>
.product_img img {
    border:solid 3px #fff;
    margin-right:5px;
}
.product_img img.hover {
    border-color:#ff8800;
}
.product_img img.current {
    border-color:#df0001;
}
.img_box_edit{position:absolute;width:170px;height:170px;right:40px;top:135px;}
</style>
<div style="width:600px; height:460px; overflow:hidden;padding: 5px; ">
   <form class="J_ajaxForm" action="<?php echo AdminBase::U("editor") ?>" method="post" id="myform">
   <div class="table_full">
   <table width="100%" class="table_form contentWrap">
        <tbody>
          <tr>
            <th width="80">商品标题</th>
            <td>
            <input type="text" name="goods_name" value="<?php echo $data->goods_name ?>" class="input length_4" id="goods_name">
            <span> 活动价格：<input type="text" name="promo_price" class="input length_1" value="<?php echo  number_format($data->promo_price,2)?>" id="promo_price"></span>
            </td>
          </tr>
           <tr>
            <th>爱淘宝URL</th>
            <td><input type="test" name="click_url" class="input length_6" id="click_url" value="<?php echo $data->click_url ?>"></td>
          </tr>       
          <tr>
            <th>商品分类</th>
            <td><select name="cat_id">
                    <option value="0">请选择商品分类</option>
                    <?php echo CategoryModel::model()->htmlCategorySelectOption($data->cat_id) ?>
                    </select></td>
          </tr>
         <tr>
          <th>上下架时间</td>
          <td><input type="text" name="start_time" class="input length_2 " value="<?php echo  date('Y-m-d H:i',$data->start_time)?>" placeholder="上架时间"> - <input type="text" name="end_time" class="input length_2 " value="<?php echo  date('Y-m-d H:i',$data->end_time)?>" placeholder="下架时间"></td>
         </tr>
         <tr>
          <th>扩展属性</td>
          <td>
          <input type="hidden" value="0" name="is_best">
          <input type="hidden" value="0" name="is_new">
          <input type="hidden" value="0" name="is_hot">
          <input type="hidden" value="0" name="is_format">
          <input type="checkbox" name="is_best" <?php echo $data->is_best?'checked':'' ?> value="1"> 推荐 <input type="checkbox" name="is_new" <?php echo $data->is_new?'checked':'' ?> value="1"> 新品 <input type="checkbox" name="is_hot" <?php echo $data->is_hot?'checked':'' ?> value="1"> 热卖 <input type="checkbox" name="is_format" <?php echo $data->is_format?'checked':'' ?> value="1"> 多规格</td>
         </tr>
         <tr>
          <th>商品销量</td>
          <td><input type="text" name="sales" class="input length_1" value="<?php echo  $data->sales?>" id="sales"> <em>商品排序：</em><input type="text" name="listorder" class="input length_1" value="<?php echo  (int)$data->listorder?>"> <span>Level：<?php echo Form::select(array(0=>'普通商品',1=>'在首页显示',2=>'秒杀商品'),$data->level,'name="level"'); ?></span></td>
         </tr>
         <tr>
          <th>商品图片</td>
          <td><input type="text" name="product_img" value="<?php echo $data->product_img ?>" class="input" id="product_img" style="width:400px">
          <div class="product_img img_box_edit">
          <img class="current" width="160" height="160" src="<?php echo $data->product_img ?>">
          </div>
          </td>
         </tr>
         <tr>
          <th>审核结果</td>
          <td><?php 
		  $statusTags = GoodsBmModel::model()->getStatusTags();
		  if($data->status != 4){
			  unset($statusTags[4]);
		  }
		  echo Form::radio($statusTags,$data->status,'name="status"'); 
		  ?> <label><input name="is_show_wangwang" type="checkbox" value="1" <?php echo $data->is_show_wangwang?'checked':'' ?> /><font color="#0000FF">显示旺旺</font></label></td>
         </tr>
         <tr>
          <th>审核操作原因</td>
          <td><textarea type="text" name="note" cols="60" rows="3" style="height:50px;width:400px;"><?php echo $data->note ?></textarea></td>
         </tr>
        </tbody>
      </table>
   </div>
      <div class="pop_bottom" >             
        <input type="hidden" name="goods_id" value="<?php echo $data->goods_id ?>">
        <button class="btn btn_submit mr10 J_ajax_submit_btn_editor fr" type="submit">确认修改</button>
      </div>
    </form>
</div>
<script src="<?php echo $staticUrl; ?>statics/js/common.js"></script>
<script>
var ajaxForm_list = $('form.J_ajaxForm');
    if (ajaxForm_list.length) {
        Wind.use('ajaxForm', 'artDialog', function() {

            if ($.browser.msie) {
                //ie8及以下，表单中只有一个可见的input:text时，会整个页面会跳转提交
                ajaxForm_list.on('submit', function(e) {
                    //表单中只有一个可见的input:text时，enter提交无效
                    e.preventDefault();
                });
            }

            $('button.J_ajax_submit_btn_editor').on('click', function(e) {
                e.preventDefault();
                /*var btn = $(this).find('button.J_ajax_submit_btn'),
					form = $(this);*/
                var btn = $(this),
                    form = btn.parents('form.J_ajaxForm');

                //批量操作 判断选项
                if (btn.data('subcheck')) {
                    btn.parent().find('span').remove();
                    if (form.find('input.J_check:checked').length) {
                        var msg = btn.data('msg');
                        if (msg) {
                            art.dialog({
                                id: 'warning',
                                icon: 'warning',
                                content: btn.data('msg'),
                                cancelVal: '关闭',
                                cancel: function() {
                                    btn.data('subcheck', false);
                                    btn.click();
                                }
                            });
                        } else {
                            btn.data('subcheck', false);
                            btn.click();
                        }

                    } else {
                        $('<span class="tips_error">请至少选择一项</span>').appendTo(btn.parent()).fadeIn('fast');
                    }
                    return false;
                }

                //ie处理placeholder提交问题
                if ($.browser.msie) {
                    form.find('[placeholder]').each(function() {
                        var input = $(this);
                        if (input.val() == input.attr('placeholder')) {
                            input.val('');
                        }
                    });
                }

                form.ajaxSubmit({
                    url: btn.data('action') ? btn.data('action') : form.attr('action'), //按钮上是否自定义提交地址(多按钮情况)
                    dataType: 'json',
                    beforeSubmit: function(arr, $form, options) {
                        var text = btn.text();

                        //按钮文案、状态修改
                        btn.text(text + '中...').prop('disabled', true).addClass('disabled');
                    },
                    success: function(data, statusText, xhr, $form) {
                        var text = btn.text();

                        //按钮文案、状态修改
                        btn.removeClass('disabled').text(text.replace('中...', '')).parent().find('span').remove();

                        if (data.state === 'success') {
							$('<span class="tips_success">' + data.info + '</span>').appendTo(btn.parent()).fadeIn('slow').delay(1000).fadeOut(function() {
                                //关闭弹窗
								var list = art.dialog.list;
								for (var i in list) {
									list[i].close();
								};
								//重新加载
								var goods_id = <?php echo $data->goods_id ?>;
								loadGoods(goods_id);
								/*$.get('<?php echo AdminBase::U("public_load") ?>',{goods_id:goods_id},function(data){
									if(data != ''){
										$("#gbinfo_"+goods_id).html(data);
										
									}
								});*/
                            });
                        } else if (data.state === 'fail') {
                            $('<span class="tips_error">' + data.info + '</span>').appendTo(btn.parent()).fadeIn('fast');
                            btn.removeProp('disabled').removeClass('disabled');
                        }
                    }
                });
            });

        });
    }
</script>